package com.yanqu.road.server.cmd.npc;

import com.yanqu.road.pb.npc.NpcEventProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.npc.NpcEventModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.S_NPC_TRADE_GET_REWARD, desc = "获取Npc贸易奖励")
public class GetNpcTradeRewardCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		ret = player.getModule(NpcEventModule.class).getNpcTradeReward();
	}

	@Override
	public void sendData(GamePlayer player) {
		NpcEventProto.GetNpcTradeRewardRespMsg.Builder respMsg = NpcEventProto.GetNpcTradeRewardRespMsg.newBuilder();
		respMsg.setRet(ret);
		player.sendPacket(Protocol.U_NPC_TRADE_GET_REWARD, respMsg);
	}
}
